package com.us.usws.site.ws.entity.shared.meeting;

import org.codehaus.jackson.annotate.JsonPropertyOrder;

import com.us.usws.common.EpServerConstants;
import com.us.usws.model.domain.epserver.EpMscServerInfo;

@JsonPropertyOrder({ "host", "port", "type" })
public class WSSharedMeetingServer {

	private String host;
	private Integer port;
	private String type;

	public WSSharedMeetingServer(String host, Integer port, String type) {
		this.host = host;
		this.port = port;
		this.type = type;
	}

	public WSSharedMeetingServer(EpMscServerInfo s) {
		this.host = s.getIp();
		this.port = s.getPort();
		if (s.getRole() == EpServerConstants.EP_MSC_INFO_ROLE_MVIDEO || s.getRole() == EpServerConstants.EP_MSC_INFO_ROLE_SVIDEO) {
			this.type = EpServerConstants.EP_WS_MEETING_SERVER_TYPE_VIDEO;
		} else if (s.getRole() == EpServerConstants.EP_MSC_INFO_ROLE_MWB || s.getRole() == EpServerConstants.EP_MSC_INFO_ROLE_SWB) {
			this.type = EpServerConstants.EP_WS_MEETING_SERVER_TYPE_WHITE_BOARD;
		}
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public Integer getPort() {
		return port;
	}

	public void setPort(Integer port) {
		this.port = port;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

}
